Skip to content

Conversation

@jcobis
Copy link
Collaborator

@jcobis jcobis commented Nov 14, 2025

Description

  • Batch insertions
image
  • Instruct users to install Faker version: v9.9.0
  • Enhance script with more logs
  • Update button copy to "Generate script"

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • If this change could impact the load on the MongoDB cluster, please describe the expected and worst case impact
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@github-actions github-actions bot added the feat label Nov 14, 2025
In the directory that you created, create a file named
mockdatascript.js (or any name you'd like).
In the directory that you created, create a file named{' '}
<strong>mockdatascript.js</strong> (or any name you&apos;d like).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bolding this

@jcobis jcobis marked this pull request as ready for review November 14, 2025 03:45
@jcobis jcobis requested a review from a team as a code owner November 14, 2025 03:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the mock data generator script in Compass by adding batched insertions, improved logging, and version pinning. The changes address several QA items including specifying Faker v9.9.0, implementing batch processing for better performance with large document counts, and adding detailed progress logging.

Key changes:

  • Pin Faker installation to version 9.9.0 to ensure consistency
  • Implement batched insertions (1000 documents per batch) to improve performance and memory usage
  • Add comprehensive logging for generation progress, timing, and completion status

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
script-screen.tsx Updated installation command to specify Faker v9.9.0 and added strong emphasis to filename in instructions
script-generation-utils.ts Implemented batch insertion logic with 1000 document batches and added detailed console logging throughout the generation process
Comments suppressed due to low confidence (2)

packages/compass-collection/src/components/mock-data-generator-modal/script-generation-utils.ts:1

  • The log message 'Batch inserted successfully' doesn't include information about which batch was inserted or how many documents it contained. Consider adding batch number and size details for better debugging and progress tracking, e.g., console.log(\Batch ${Math.floor(batchStart / BATCH_SIZE) + 1}/${numBatches} inserted successfully (${insertResult.insertedCount} documents).`);`
import type { FakerFieldMapping } from './types';

packages/compass-collection/src/components/mock-data-generator-modal/script-generation-utils.ts:1

  • The final summary log is missing information about the total number of documents successfully inserted. Consider adding a log line like console.log(\Total documents inserted: ${TOTAL_DOCUMENTS}`);` to confirm the operation completed as expected.
import type { FakerFieldMapping } from './types';

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jcobis jcobis requested a review from ckramer10 November 14, 2025 03:48
}
>
npm install @faker-js/faker
npm install @faker-js/faker@9.9.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is to avoid breaking changes, can we do just major to allow future fixes?

Suggested change
npm install @faker-js/faker@9.9.0
npm install @faker-js/faker@9

Copy link
Collaborator

@paula-stacho paula-stacho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small suggestion, otherwise looks good!

@jcobis jcobis added the no release notes Fix or feature not for release notes label Nov 14, 2025
@jcobis jcobis merged commit 4086459 into main Nov 14, 2025
54 of 56 checks passed
@jcobis jcobis deleted the CLOUDP-356792 branch November 14, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants